# 有一个长阶梯,若每步上2阶,最后剩1阶;若每步上3阶,最后剩2阶;若每步上5阶,最后剩4阶;若每步上6阶,最后剩5阶;
# 只有每步上7阶,最后刚好一阶也不剩,请编程求解该阶梯至少有多少阶?
c = 7
while c < 1000:
    if c % 2 == 1 and c % 3 == 2 and c % 5 == 4 and c % 6 == 5 and c % 7 == 0:
        print(c, end=' ')
    else:
        pass
    c += 7
